<%-- 16/12/2011 --%>

<%@include file="../common/include.jsp" %>
<%@ taglib uri="/WEB-INF/tld/portal.tld" prefix="wps" %> 
<%@ taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v61/portlet/ibm-portlet-ext" prefix="portlet-ext" %>
<%@ page import="com.ibm.portal.state.EngineURL" %>

<portlet:defineObjects />

<script src='<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/js/jquery.ba-bbq.min.js")%>' type="text/javascript" ></script>

<c:if test="${cliente.debeCambiarContrasena}">
	<div style="display: none;">
		<wps:urlGeneration contentNode="rimac2.page.cambiarcontrasena" portletWindowState="NoCheck">
			<wps:urlParam name="initialState" value="enrollment" />
			<wps:urlParam name="firstLogin" value="true" />
			<a id="link-oculto" href="<% wpsURL.write(out); %>">Fancy Box</a>
		</wps:urlGeneration>
	</div>

	<script type="text/javascript">
		$(document).ready(function() {
			
			$(window).bind('hashchange', function (e) {
				var mostrar=  e.getState("mostrarcambio") || 'true';
			    if(mostrar=='true'){
<%--
			    	<c:set var="firstLogin" value="1" scope="session" />
--%>
			    	$("#link-oculto").fancybox({
						onStart	: function() {
									$('#fancybox-outer').css('background','none');
									$('.fancy-bg').css('display', 'none');
									$('.fancybox-bg').css('display', 'none');
									$('#fancybox-overlay').css('z-index','999999999999999999');
									$('#fancybox-wrap').css('z-index','999999999999999999');
									$.cookie("firstLogin", "1",{ path: "/"});
						},				
						margin: 0, 
						showCloseButton: false,
						titleShow: false,
						padding: 0,
						overlayColor: '#000',
						overlayOpacity: 0.8,
						scrolling: 'no',
						type : 'iframe',
						'hideOnOverlayClick':false,
					    'hideOnContentClick':false,
						'width' : 600,
						'height' : 340

					}).trigger('click'); 
			    }
			});
			
			$(window).trigger('hashchange');
			
		});
	</script>
</c:if>